﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


public partial class SiteMaster : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.User.Identity.IsAuthenticated)//HttpContext.Current.User.Identity.IsAuthenticated
        {
            Label l4 = HeadLoginView.FindControl("Label4") as Label;
            string tmp = null;
            foreach (string s in Roles.GetRolesForUser()) 
            {
                tmp += s + " ";
            }
            l4.Text = tmp;

            if (Session["DepartmentName"] != null)
            {
                //在用户保存登录状态时无效，待解决。
                Label l5 = HeadLoginView.FindControl("lb_dep_name") as Label;
                l5.Text = Session["DepartmentName"].ToString();
            }
        }
    }
}
